package re;

import nfa.NFADesign;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * @author haoly
 * @title LiteralTest
 * @date 2025/4/17 11:05
 * @description TODO
 */
public class LiteralTest {
    @Test
    void testAccepts() {
        Pattern pattern = new Literal('a');
        NFADesign nfaDesign = pattern.toNFADesign();

        assertFalse(nfaDesign.accepts(""));
        assertTrue(nfaDesign.accepts("a"));
        assertFalse(nfaDesign.accepts("b"));
    }
}
